﻿@using Nop.Core.Domain.Media
@{
    Layout = "~/Views/Shared/_Root.cshtml";
}
@{
    //current category ID
    int currentCategoryId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("category", StringComparison.InvariantCultureIgnoreCase))
    {
        currentCategoryId = Convert.ToInt32(Url.RequestContext.RouteData.Values["categoryId"].ToString());
    }


    //current manufacturer ID
    int currentManufacturerId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("manufacturer", StringComparison.InvariantCultureIgnoreCase))
    {
        currentManufacturerId = Convert.ToInt32(Url.RequestContext.RouteData.Values["manufacturerId"].ToString());
    }
    //current store ID
    int currentStoreId = Nop.Core.Domain.Stores.Store.AllStoreReservedId;
    //if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
    //    Url.RequestContext.RouteData.Values["action"].ToString().Equals("store", StringComparison.InvariantCultureIgnoreCase))
    if (Url.RequestContext.RouteData.Values.ContainsKey("storeId"))
    {
        currentStoreId = Convert.ToInt32(Url.RequestContext.RouteData.Values["storeId"].ToString());
    }

    //current product ID
    int currentProductId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("product", StringComparison.InvariantCultureIgnoreCase))
    {
        currentProductId = Convert.ToInt32(Url.RequestContext.RouteData.Values["productId"].ToString());
    }
}
<div id="sh-main" class="@currentCategoryId master-wrapper-main columns-two">
    <div class="sh-left-sidebar frontpage">
        <div id="sh-left-menu-block">
            @if (IsSectionDefined("left"))
            {
                @RenderSection("left")
            }
               
            @*Html.Action("CategoryNavigationFront", "Catalog", new { area = "Commerce", currentCategoryId = currentCategoryId, currentProductId = currentProductId, storeId = currentStoreId })*@
            @Html.Action("CategoryNavigationFront2", "Catalog", new { area = "Commerce", storeId = currentStoreId })

            @if (currentStoreId == 1)
            {
                @Html.Action("StaticLinkShow", "PictureDisplay", new { area = "Commerce", type = (int)PictureDisplayType.HomePageLeft })
            }
            else
            {
                @Html.Action("StaticLinkShow", "PictureDisplay", new { area = "Commerce", type = (int)PictureDisplayType.HomePageLeft, contentCategory = "store", contentId = currentStoreId })
            }
        </div>

        <div class="content-float-clear">
        </div>

    </div>

    <div class="sh-top-content slideshow">
        <div id="sh-slideshow">
            @Html.Action("Slideshow", "PictureDisplay", new { area = "Commerce", type = ((int)PictureDisplayType.HomePageTop) })
        </div>
    </div>

    <div class="sh-content">
        @RenderBody()
    </div>

</div>